import { Redirect } from 'react-router-dom'
import store from '@/store'

export default function UserHOC(OldComponent) {
    return (props) => {
        let isLogin = store.getState().login.isLogin
        return isLogin ? <OldComponent {...props} /> : <Redirect  to='/login' />
    }
    
}